{% extends "../main.html" %}
{% block head_js %}
<!--link href="http://cdn.datatables.net/1.10.0/css/jquery.dataTables.css" rel="stylesheet"-->
<link href="{{ static_url('datatable/jquery.dataTables.css') }}" rel="stylesheet">

{% end %}

{% block bodyy %}
<h3 class="sub-header">用户管理</h3>
<form  action="/users/update" method="get">
    <table id="example" class="table table-striped">
        <thead>
            <tr>
                 <th>ID</th><th>姓名</th><th>邮箱</th><th>账号状态</th><th>联系电话</th><th>权限等级</th><th>注册日期</th><th>操作</th>
             </tr>
         </thead>
        <tbody>
        {% for i in data %}
             <tr>
                 <td>{{i[0]}}</td><td>{{i[1]}}</td><td>{{i[2]}}</td>
                 <td>{% if i[3] %}<font color="green">正常</font>{% else %}<font color="red">禁用</font>{% end %}</td>
                 <td>{{i[4]}}</td><td>{{i[5]}}</td><td>{{i[6]}}</td>
                 <td>
                     <button type="submit" class="btn btn-xs btn-primary" name="id" value={{i[0]}}>编辑</button>
                     <!--button type="submit" class="btn btn-danger" name="delete" value="{{i[1]}}">删除</button-->
                     <a href="/delete/users/{{i[0]}}"><button type="button" class="btn btn-xs btn-danger" >删除</button></a>
                 </td>
             </tr>
        {% end %}
        </tbody>
     </table>

</form>
{% end %}
{% block body_js %}
<!--script src="https://cdn.datatables.net/1.10.8/js/jquery.dataTables.min.js"></script-->
<script src="{{ static_url('datatable/jquery.dataTables.min.js') }}"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('#example').dataTable({
            "language": {
                "url": "{{ static_url('datatable/Chinese.json') }}"
            }
        });
    });
</script>
{% end %}